var t = function(t) {
    return (t = t.toString())[1] ? t : "0" + t;
};

module.exports = {
    formatTime: function(e) {
        var n = e.getFullYear(), r = e.getMonth() + 1, a = e.getDate(), i = e.getHours(), o = e.getMinutes(), u = e.getSeconds();
        return [ n, r, a ].map(t).join("/") + " " + [ i, o, u ].map(t).join(":");
    },
    convert2TecentMap: function(t, e) {
        if ("" == t && "" == e) return {
            lng: "",
            lat: ""
        };
        var n = 52.35987755982988, r = t - .0065, a = e - .006, i = Math.sqrt(r * r + a * a) - 2e-5 * Math.sin(a * n), o = Math.atan2(a, r) - 3e-6 * Math.cos(r * n);
        return {
            lng: i * Math.cos(o),
            lat: i * Math.sin(o)
        };
    },
    setRubTime: function(t) {
        var e = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1];
        if (t) {
            var n = new Date(t), r = n.getFullYear(), a = n.getMonth() + 1, i = n.getDate();
            return e ? r + "-" + (a < 10 ? "0" + a : a) + "-" + (i < 10 ? "0" + i : i) : r + "-" + (a < 10 ? "0" + a : a) + "-" + (i < 10 ? "0" + i : i) + " " + n.toTimeString().substr(0, 5);
        }
    },
    setPrice: function(t) {
        return 0 != t && null !== t && "undefined" != t && t ? t ? parseFloat(t) / 100 : void 0 : 0;
    }
};